<template>
	<view class="bg">
		<view class="list" >
			<view class="item" v-for="(i,index) in list" @tap="toPage(i.id)">
				<image :src="i.mainImg"></image>
				<view class="info">
					<text>{{i.title}}</text>
					<view>{{i.info}}</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title: 'Hello',
				list:[
					{
						id:1,
						mainImg:'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fp1-q.mafengwo.net%2Fs7%2FM00%2F25%2FE2%2FwKgB6lPh4UeARKPpAABh4pruLDc72.jpeg%3FimageMogr2%252Fthumbnail%252F%21310x207r%252Fgravity%252FCenter%252Fcrop%252F%21310x207%252Fquality%252F90&refer=http%3A%2F%2Fp1-q.mafengwo.net&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1619356838&t=e1c284d706d7cee9bf3839074a31315c',
						title:'这是标题这是标',
						info:'这是内容是内容这'
					},
					{
						id:2,
						mainImg:'https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fp1-q.mafengwo.net%2Fs7%2FM00%2F25%2FE2%2FwKgB6lPh4UeARKPpAABh4pruLDc72.jpeg%3FimageMogr2%252Fthumbnail%252F%21310x207r%252Fgravity%252FCenter%252Fcrop%252F%21310x207%252Fquality%252F90&refer=http%3A%2F%2Fp1-q.mafengwo.net&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1619356838&t=e1c284d706d7cee9bf3839074a31315c',
						title:'这是标题这是标',
						info:'这是内容'
					},
				]
			}
		},
		onLoad() {

		},
		methods: {
			toPage(id){
				uni.navigateTo({
					url:`../info/info?id=${id}`
				})
			}
		}
	}
</script>

<style lang="scss">
	.bg{
		background-color: #fff;
	}
	.list{
		display: flex;
		flex-direction: column;
		.item{
			display: flex;
			padding: 30rpx;
			align-items: center;
			border-bottom: 1rpx solid #eee;
			transition: .2s;
			&:active{
				background-color: #f2f2f2;
			}
			image{
				width: 200rpx;
				height: 120rpx;
				border-radius: 20rpx;
			}
			.info{
				margin-left: 20rpx;
				text{
					
					font-size: 14px;
					color: #333;
				}
				view{
					margin-top: 20rpx;
					font-size: 12px;
					color: #999;
				}
			
			}
		}
	}
</style>
